Fix Garbage Characters in Resume Parser#8274
Conversation
…nt timeout on large repos
Fixes JhaSourav07#6096 by preserving valid UTF-8, avoiding faulty binary text fallbacks, and adding heuristic to repair misencoded artifacts.
|
@pisum-sativum is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
This pull request resolves a critical issue with the resume parser by enhancing its ability to handle UTF-8 characters and removing unwanted artifacts. This aligns with our previous decisions on bug fixes aimed at improving code quality, such as the recent fix for dead code in the calculateStreak function. Thank you for your contribution, and I look forward to your updates! |
|
@JhaSourav07 I have done the necessary changes kindly check and merge with appropriate labels. |
…owing them Moves buffer header checks outside try/catch blocks so that failures in buffer.toString (e.g. in tests mocking the method) correctly propagate to callers. Only third-party parser failures (pdf-parse, mammoth) are silently caught. Fixes the failing error-resilience test.
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod007
left a comment
There was a problem hiding this comment.
Thanks for fixing the resume parser encoding issue! Handling Latin-1 character mangling is a tricky bug, and the fallback parsing logic looks solid.
However, it looks like this PR accidentally includes some unrelated changes. You have modified files like \lib/github.ts, \services/github/ci-analytics.ts, and \�pp/generator/data/socials.ts, which don't seem related to the resume parsing fix.
Please revert the changes to those files so that the PR focuses solely on \lib/resume-parser.ts.
Looking forward to getting this merged once the branch is cleaned up!
Label Justification:
- \level:intermediate: Debugging and writing fixes for encoding issues and buffer parsing is an intermediate task.
- \ ype:bug: Fixes broken character rendering when parsing CV files.
- \mentor:Aamod007: Assigned as required.
|
🚨 Hey @pisum-sativum, the CI Pipeline is failing on this PR and it has been marked as Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run format:check # Check Prettier formatting
npm run lint # Run ESLint
npm run typecheck # TypeScript type check
npm run test # Run unit tests (Vitest)
npm run build # Verify production build passes2. Auto-fix common issues: npm run format # Auto-fix formatting with Prettier
npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
…bage-chars # Conflicts: # components/burnout/BurnoutRiskTable.tsx
…, and achievements types
…files to origin/main
Description
Fixes #6096
This PR resolves an issue with the resume parsing engine where valid UTF-8 characters were aggressively stripped out while misencoded garbage characters and decoding artifacts (such as
é,\uFFFD) polluted the extracted text.Key changes include:
Pillar
Visual Preview
(Not applicable as this is a backend parser fix, but the dashboard preview will no longer contain garbage formatting artifacts.)
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.